<!DOCTYPE html>
<html xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
      xmlns:th="http://www.thymeleaf.org" layout:decorate="main"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
<head>
    <title>医生排班</title>
    <link th:href="@{/localcss/crmlist.css}" href="../static/localcss/crmlist.css" rel="stylesheet">

    <style>
        .x_nb {
            height: 450px;
        }

        .white_content {
            display: none;
            position: absolute;
            top: 20%;
            left: 40%;
            width: 22%;
            height: 550px;
            padding: 20px;
            border: 1px solid #9CC2CB;
            background-color: white;
            z-index: 1002;
            overflow: auto;
        }

        .chatb {
            margin-left: 350px;
            margin-bottom: 10px;
        }

        #col-i {
            width: 200px;
        }

        #light ul li {
            list-style: none;
            height: 50px;
        }

        #light ul li {
            list-style: none;
            height: 50px;
        }

        #light ul li span {
            float: right;
        }

        .form-group input {
            width: 200px;
        }

        .form-group select {
            width: 200px;
        }

        .form-radio input {
            margin-left: 20px;
        }

        .form-group button {
            margin-top: 30px;
            margin-left: 80px;
        }

    </style>
</head>
<body>
<div layout:fragment="content">
    <div id="light" class="white_content">
        <div class="x_nb">
            <div class="x_title">
                <h2>修改排班 <i class="fa fa-user"></i></h2>
                <div class="chatb">
                    <button onclick="document.getElementById('light').style.display='none';">
                        ✖
                    </button>
                </div>
                <div class="clearfix"></div>
            </div>
            <div class="x_content">
                <form class="form-horizontal form-label-left" id="fpaiban" method="post"
                      action="/scheduling/editPaiban">
                    <input type="hidden" id="docId" name="doctorId">
                    <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="one">星期一<span
                                class="required">*</span></label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                            <select name="one" id="one" class="form-control">
                                <option value="0">--请选择--</option>
                            </select>
                        </div>
                    </div>
                    <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="two"> 星期二 <span
                                class="required">*</span></label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                            <select name="two" id="two" class="form-control">
                                <option value="0">--请选择--</option>
                            </select>
                        </div>
                    </div>
                    <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="three"> 星期三 <span
                                class="required">*</span></label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                            <select name="three" id="three" class="form-control">
                                <option value="0">--请选择--</option>
                            </select>
                        </div>
                    </div>
                    <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="four"> 星期四 <span
                                class="required">*</span></label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                            <select name="four" id="four" class="form-control">
                                <option value="0">--请选择--</option>
                            </select>
                        </div>
                    </div>
                    <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="five"> 星期五 <span
                                class="required">*</span></label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                            <select name="five" id="five" class="form-control">
                                <option value="0">--请选择--</option>
                            </select>
                        </div>
                    </div>
                    <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="six"> 星期六 <span
                                class="required">*</span></label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                            <select name="six" id="six" class="form-control">
                                <option value="0">--请选择--</option>
                            </select>
                        </div>
                    </div>
                    <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="seven"> 星期日 <span
                                class="required">*</span></label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                            <select name="seven" id="seven" class="form-control">
                                <option value="0">--请选择--</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <button id="send" type="button" class="btn btn-success">保存</button>
                        <button type="button" class="btn btn-primary" id="back">重置</button>
                    </div>
                </form>
            </div>
        </div>
    </div>


    <div class="col-md-12 col-sm-12 col-xs-12">
        <div class="x_panel">
            <div class="x_title">
                <h2>
                    查询条件 <i class="fa fa-user"></i>
                    <small>
                        - 您可以通过搜索或者其他的筛选项对用户的信息进行编辑、删除等管理操作。^_^
                    </small>
                </h2>
                <div class="clearfix"></div>
            </div>
            <div class="x_content">
                <form method="post" action="/scheduling/schedulingList">
                    <input type="hidden" name="current" th:value="1">
                    <ul>
                        <li>
                            <div class="form-group" id="userxx">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12">姓名：</label>
                                <div class="col-md-6 col-sm-6 col-xs-12">
                                    <input id="col-i" name="doctorName" type="text"
                                           class="form-control col-md-6 col-xs-12" th:value="${doctorName}">
                                </div>
                            </div>
                        </li>
                        <li>
                            <button type="submit" class="btn btn-primary" id="doSearch"> 查 &nbsp;&nbsp;&nbsp;&nbsp;询
                            </button>
                        </li>
                    </ul>
                </form>
            </div>
            <div class="x_content">
                <p class="text-muted font-13 m-b-30"></p>
                <div id="datatable-responsive_wrapper"
                     class="dataTables_wrapper form-inline dt-bootstrap no-footer">
                    <div class="row">

                        <div class="col-sm-12">
                            <table id=" datatable-responsive"
                                   class="table table-striped table-bordered dt-responsive nowrap dataTable no-footer
                            dtr-inline collapsed"
                                   cellspacing="0" width="100%" role="grid"
                                   aria-describedby="datatable-responsive_info" style="width: 100%;">
                                <thead>
                                <tr role="row">
                                    <th class="sorting_asc" tabindex="0"
                                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                        aria-label="First name: activate to sort column descending"
                                        aria-sort="ascending">ID
                                    </th>
                                    <th class="sorting" tabindex="0"
                                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                        aria-label="Last name: activate to sort column ascending">
                                        姓名
                                    </th>
                                    <th class="sorting" tabindex="0"
                                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                        aria-label="Last name: activate to sort column ascending">
                                        星期一
                                    </th>
                                    <th class="sorting" tabindex="0"
                                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                        aria-label="Last name: activate to sort column ascending">
                                        星期二
                                    </th>
                                    <th class="sorting" tabindex="0"
                                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                        aria-label="Last name: activate to sort column ascending">
                                        星期三
                                    </th>
                                    <th class="sorting" tabindex="0"
                                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                        aria-label="Last name: activate to sort column ascending">
                                        星期四
                                    </th>
                                    <th class="sorting" tabindex="0"
                                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                        aria-label="Last name: activate to sort column ascending">
                                        星期五
                                    </th>
                                    <th class="sorting" tabindex="0"
                                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                        aria-label="Last name: activate to sort column ascending">
                                        星期六
                                    </th>
                                    <th class="sorting" tabindex="0"
                                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                        aria-label="Last name: activate to sort column ascending">
                                        星期日
                                    </th>
                                    <th class="sorting" tabindex="0"
                                        aria-controls="datatable-responsive" rowspan="1" colspan="1"
                                        aria-label="Last name: activate to sort column ascending">
                                        操作
                                    </th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr role="row" class="odd" th:each="scheduling:${scheduling.records}">
                                    <td tabindex="0" class="sorting_1" th:text="${scheduling.doctorId}">doctorId</td>
                                    <td th:text="${scheduling.doctorName}">doctorName</td>
                                    <td th:text="${scheduling.one}">one</td>
                                    <td th:text="${scheduling.two}">two</td>
                                    <td th:text="${scheduling.three}">three</td>
                                    <td th:text="${scheduling.four}">four</td>
                                    <td th:text="${scheduling.five}">five</td>
                                    <td th:text="${scheduling.six}">six</td>
                                    <td th:text="${scheduling.seven}">seven</td>
                                    <td>
                                        <div class="btn-group">
                                            <button class="btn btn-danger" th:onclick="|addtc(${scheduling.doctorId})|">
                                                编辑
                                            </button>
                                        </div>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                            <div class="row">
                                <div class="col-sm-5">
                                    <div class="dataTables_info" id="datatable-responsive_info"
                                         role="status" aria-live="polite">共<span
                                            th:text="${scheduling.size }">1</span>条记录
                                        <span th:text="${scheduling.current }">1</span>/<span
                                                th:text="${scheduling.pages }">1</span>页
                                    </div>
                                </div>
                                <div class="col-sm-7">
                                    <div class="dataTables_paginate paging_simple_numbers"
                                         id="datatable-responsive_paginate">
                                        <ul class="pagination">
                                            <li class="paginate_button previous" th:if="${scheduling.current gt 0}"><a
                                                    href="javascript:page_navg(document.forms[1],1);"
                                                    aria-controls="datatable-responsive" data-dt-idx="0"
                                                    tabindex="0">首页</a>
                                            </li>
                                            <li class="paginate_button " th:if="${scheduling.current gt 0}"><a
                                                    href="#"
                                                    th:onclick="'javascript:page_navg(document.forms[1],'+${scheduling.current}+');'"
                                                    aria-controls="datatable-responsive" data-dt-idx="1"
                                                    tabindex="0">上一页</a>
                                            </li>
                                            <li class="paginate_button "
                                                th:if="${(scheduling.current+1) lt scheduling.pages}"><a
                                                    href="#"
                                                    th:onclick="'javascript:page_navg(document.forms[1],'+${scheduling.current+1 }+');'"
                                                    aria-controls="datatable-responsive" data-dt-idx="1"
                                                    tabindex="0">下一页</a>
                                            </li>
                                            <li class="paginate_button next"
                                                th:if="${(scheduling.current+1) lt scheduling.pages}"><a
                                                    href="#"
                                                    th:onclick="'javascript:page_navg(document.forms[1],'+${scheduling.pages }+');'"
                                                    aria-controls="datatable-responsive" data-dt-idx="7"
                                                    tabindex="0">最后一页</a>
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
</body>
<script layout:fragment="js">
    //点击编辑事件
    function addtc(date) {
        $("#docId").val(date);
        $.ajax({
            url: '/scheduling/findAllBan',
            dataType: 'json',
            type: 'post',
            success: function (data) {
                $(data).each(function () {
                    //拼接科室下拉框
                    var doption = "<option value=" + this.bname + ">" + this.bname + "</option>";
                    $(".form-control").append(doption);// 下拉菜单里添加元素
                });
            }
        });
        //显示添加弹框
        document.getElementById('light').style.display = 'block';
    }

    //点击保存进行判断提交
    $("#send").click(function () {
        if ($(".form-control").val() == 0) {
            alert("请选择内容");
        } else {
            $("#fpaiban").submit();
        }
    });
    //点击重置
    $("#back").click(function () {
        $(".form-control").val(0);
        $("#col-i").val("");
    })
</script>
</html>